/*
 *	Copyright (C) 2008 - Mauricio Bieze Stefani
 *	This file is part of the Insano Game Engine.
 *
 *	Insano is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	Insano is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with Insano.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef PROTOCOL_H_INCLUDED
#define PROTOCOL_H_INCLUDED

#define MAX_NAME	10
#define MAX_MSG		100

typedef unsigned char COMANDO;
enum ComandosProtocolo
{
	CHAT_CLI_SRV,
	/*	chat message from client to server
		char[MAX_NAME+1]	to
		char[MAX_MSG+1]		message
	*/
	CHAT_SRV_CLI,
	/*
		chat message from server to client
		char[MAX_NAME+1]	from
		char[MAX_MSG+1]		message
	*/
	CREATE_ACC_REQ,
	/*	create new account
		char[MAX_NAME+1]	user
		char[MAX_NAME+1]	password
	*/
	CREATE_ACC_OK,
	CREATE_ACC_DENY,
	LOGIN_REQ,
	/*	login request
		char[MAX_NAME+1]	user
		char[MAX_NAME+1]	password
	*/
	LOGIN_OK,
	LOGIN_DENY,
	CHAR_LST_REQ,
	CHAR_LST_REP,
	/*	list containing all chars belonging to current account
		byte			number of chars available
		array[n]
		{
			int32				char_id
			char[MAX_NAME+1]	nick
			byte				race
			byte				gender
		}
	*/
	CREATE_CHAR_REQ,
	/*	create new char
		char[MAX_NAME+1]	nick
		byte				race
		byte				gender
	*/
	CREATE_CHAR_OK,
	CREATE_CHAR_DENY,
	LOGIN_CHAR_REQ,
	/*	login to existing char
		int32			char_id
	*/
	LOGIN_CHAR_OK,
	LOGIN_CHAR_DENY,
	PDU,
	ENT_NFO_REQ,
	ENT_NFO_REP,
	VISUAL_NFO_REQ,
	VISUAL_NFO_REP
};

struct ProtoCharDef
{
	unsigned long id;
	char name[MAX_NAME+1];
	unsigned char race;
	unsigned char gender;
};

struct ProtoCharList
{
	unsigned char numChars;
	ProtoCharDef chars[10];
};

//TODO: make commands OO
/*
class NetLoginRequest : public Buffer
{
	public:
		NetLoginRequest() : Buffer()
			{}
};
*/
#endif // PROTOCOL_H_INCLUDED
